import request from '@/utils/request'

// 查询规则明细表列表
export function listResolve(query) {
  return request({
    url: '/system/resolve/list',
    method: 'get',
    params: query
  })
}

// 查询规则明细表详细
export function getResolve(id) {
  return request({
    url: '/system/resolve/' + id,
    method: 'get'
  })
}

// 新增规则明细表
export function addResolve(data) {
  return request({
    url: '/system/resolve',
    method: 'post',
    data: data
  })
}

// 修改规则明细表
export function updateResolve(data) {
  return request({
    url: '/system/resolve',
    method: 'put',
    data: data
  })
}

// 删除规则明细表
export function delResolve(id) {
  return request({
    url: '/system/resolve/' + id,
    method: 'delete'
  })
}

// 查询表结构
export function listDbTable(query) {
  return request({
    url: '/system/resolve/db/list',
    method: 'get',
    params: query
  })
}

export function listDbColumn(tableName) {
  const data = {
    tableName
  }
  return request({
    url: '/system/resolve/db/columnList',
    method: 'get',
    params: data
  })
}